package at.fhooe.stefanirndorfer.entity;

import org.lwjgl.opengl.GL11;
import org.newdawn.slick.Color;
import org.newdawn.slick.opengl.Texture;

import at.fhooe.stefanirndorfer.game.Game;

public class Background extends Entity {

	Texture texture;
	
	public Background(int width, int height, double posX, double posY) {
		super(width, height, posX, posY);
		texture = null;
		loadTex();
	}
	
	public void loadTex(){		
		texture = Game.getInstance().getResource_loader().loadTexture("background.png");
	}
	

	@Override
	public void update(int delta) {
		
	}

	@Override
	public double[] getPosition() {
		
		return null;
	}

	@Override
	public void render() {
		Color.white.bind();
		texture.bind(); // or GL11.glBind(texture.getTextureID());
		GL11.glBegin(GL11.GL_QUADS);
			GL11.glTexCoord2f(0,0);
			GL11.glVertex2d(posX - width/2, posY + height/2);
			GL11.glTexCoord2f(1,0);
			GL11.glVertex2d(posX + width/2, posY + height/2);
			GL11.glTexCoord2f(1,1);
			GL11.glVertex2d(posX + width/2, posY - height/2);
			GL11.glTexCoord2f(0,1);
			GL11.glVertex2d(posX - width/2, posY - height/2);
		GL11.glEnd();
	}
	
	

}
